<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Resource lookup functions: libxfce4util Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="libxfce4util Reference Manual">
<link rel="up" href="libxfce4util-utilities.html" title="Xfce Utilities">
<link rel="prev" href="libxfce4util-utilities.html" title="Xfce Utilities">
<link rel="next" href="libxfce4util-Resource-Config-File-Support.html" title="Resource Config File Support">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libxfce4util-Resource-lookup-functions.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libxfce4util-utilities.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libxfce4util-utilities.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libxfce4util-Resource-Config-File-Support.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libxfce4util-Resource-lookup-functions"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libxfce4util-Resource-lookup-functions.top_of_page"></a>Resource lookup functions</span></h2>
<p>Resource lookup functions — Resource lookup functions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libxfce4util-Resource-lookup-functions.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceMatchFunc" title="XfceMatchFunc ()">*XfceMatchFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> **
</td>
<td class="function_name">
<a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-dirs" title="xfce_resource_dirs ()">xfce_resource_dirs</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-lookup" title="xfce_resource_lookup ()">xfce_resource_lookup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> **
</td>
<td class="function_name">
<a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-lookup-all" title="xfce_resource_lookup_all ()">xfce_resource_lookup_all</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> **
</td>
<td class="function_name">
<a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-match" title="xfce_resource_match ()">xfce_resource_match</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> **
</td>
<td class="function_name">
<a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-match-custom" title="xfce_resource_match_custom ()">xfce_resource_match_custom</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-push-path" title="xfce_resource_push_path ()">xfce_resource_push_path</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-pop-path" title="xfce_resource_pop_path ()">xfce_resource_pop_path</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-save-location" title="xfce_resource_save_location ()">xfce_resource_save_location</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libxfce4util-Resource-lookup-functions.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody><tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceResourceType" title="enum XfceResourceType">XfceResourceType</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libxfce4util-Resource-lookup-functions.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;libxfce4util/libxfce4util.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="libxfce4util-Resource-lookup-functions.description"></a><h2>Description</h2>
<p>Resource lookup functions</p>
</div>
<div class="refsect1">
<a name="libxfce4util-Resource-lookup-functions.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="XfceMatchFunc"></a><h3>XfceMatchFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
<span class="c_punctuation">(</span>*XfceMatchFunc<span class="c_punctuation">)</span> (<em class="parameter"><code>const <span class="type">gchar</span> *basedir</code></em>,
                  <em class="parameter"><code>const <span class="type">gchar</span> *relpath</code></em>,
                  <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>Return value :</p>
<div class="refsect3">
<a name="XfceMatchFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>basedir</p></td>
<td class="parameter_description"><p>basedir</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>relpath</p></td>
<td class="parameter_description"><p>relpath</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>additional user data passed to <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-match-custom" title="xfce_resource_match_custom ()"><code class="function">xfce_resource_match_custom()</code></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xfce-resource-dirs"></a><h3>xfce_resource_dirs ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> **
xfce_resource_dirs (<em class="parameter"><code><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceResourceType" title="enum XfceResourceType"><span class="type">XfceResourceType</span></a> type</code></em>);</pre>
<p>Queries the list of possible directories for the specified <em class="parameter"><code>type</code></em>
. The
first element of the list is always the save location for <em class="parameter"><code>type</code></em>
. None
of the directories returned in the list are garantied to exist.</p>
<p>This function should be rarely used. You should consider using
<a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-lookup" title="xfce_resource_lookup ()"><code class="function">xfce_resource_lookup()</code></a> or <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-match" title="xfce_resource_match ()"><code class="function">xfce_resource_match()</code></a> instead.</p>
<p>The returned list must be freed using <code class="function">g_strfreev()</code>.</p>
<div class="refsect3">
<a name="xfce-resource-dirs.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>type of the resource.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xfce-resource-dirs.returns"></a><h4>Returns</h4>
<p>list of possible directories for <em class="parameter"><code>type</code></em>
. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-4-2.html#api-index-4.2">4.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="xfce-resource-lookup"></a><h3>xfce_resource_lookup ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
xfce_resource_lookup (<em class="parameter"><code><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceResourceType" title="enum XfceResourceType"><span class="type">XfceResourceType</span></a> type</code></em>,
                      <em class="parameter"><code>const <span class="type">gchar</span> *filename</code></em>);</pre>
<p>Looks for a resource of the specified <em class="parameter"><code>type</code></em>
 whose relative path matches
<em class="parameter"><code>filename</code></em>
. <em class="parameter"><code>filename</code></em>
 can either reference a regular file, in which case
it must not end with a slash character ('/'), or a directory, when
<em class="parameter"><code>filename</code></em>
 contains a trailing slash character ('/').</p>
<p>The caller is responsible to free the returned string using <code class="function">g_free()</code>
when no longer needed.</p>
<div class="refsect3">
<a name="xfce-resource-lookup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>type of resource to lookup.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description"><p>relative filename of the resource, e.g. "xfwm4/xfwmrc".</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xfce-resource-lookup.returns"></a><h4>Returns</h4>
<p>the absolute path to the first file or directory in the
search path, that matches <em class="parameter"><code>filename</code></em>
or <code class="literal">NULL</code> if no such
file or directory could be found. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-4-2.html#api-index-4.2">4.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="xfce-resource-lookup-all"></a><h3>xfce_resource_lookup_all ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> **
xfce_resource_lookup_all (<em class="parameter"><code><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceResourceType" title="enum XfceResourceType"><span class="type">XfceResourceType</span></a> type</code></em>,
                          <em class="parameter"><code>const <span class="type">gchar</span> *filename</code></em>);</pre>
<p>Similar to <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-lookup" title="xfce_resource_lookup ()"><code class="function">xfce_resource_lookup()</code></a>, but returns all resource of the specified <em class="parameter"><code>type</code></em>
,
that whose name is <em class="parameter"><code>filename</code></em>
.</p>
<p>The caller is responsible to free the returned string array using <code class="function">g_strfreev()</code>
when no longer needed.</p>
<div class="refsect3">
<a name="xfce-resource-lookup-all.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>type of the resource to lookup.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description"><p>relative file path. If <em class="parameter"><code>filename</code></em>
contains a trailing slash character
it is taken to reference a directory, else it is taken to reference
a file.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xfce-resource-lookup-all.returns"></a><h4>Returns</h4>
<p>list of possible resources for <em class="parameter"><code>type</code></em>
. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-4-2.html#api-index-4.2">4.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="xfce-resource-match"></a><h3>xfce_resource_match ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> **
xfce_resource_match (<em class="parameter"><code><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceResourceType" title="enum XfceResourceType"><span class="type">XfceResourceType</span></a> type</code></em>,
                     <em class="parameter"><code>const <span class="type">gchar</span> *pattern</code></em>,
                     <em class="parameter"><code><span class="type">gboolean</span> unique</code></em>);</pre>
<p>Tries to find all resources with the specified <em class="parameter"><code>type</code></em>
. The function will
look into all specified directories and return all filenames in these
directories. The returned filenames are given relative the base directories
specified by <em class="parameter"><code>type</code></em>
.</p>
<p>If <em class="parameter"><code>pattern</code></em>
 contains a trailing slash, <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-match" title="xfce_resource_match ()"><span class="type">xfce_resource_match</span></a> looks only for
directories that match <em class="parameter"><code>pattern</code></em>
, else it'll only look for regular files. In
case you are looking for directories, the returned entries will contain a
trailing slash as well, so you can easily use them with other resource
functions like <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-lookup" title="xfce_resource_lookup ()"><span class="type">xfce_resource_lookup</span></a> or <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-save-location" title="xfce_resource_save_location ()"><span class="type">xfce_resource_save_location</span></a>.</p>
<p>Example: xfce_resource_match (XFCE_RESOURCE_CONFIG, "foo/bar*") will probably
return ("foo/bar", "foo/barbaz", ...).</p>
<div class="refsect3">
<a name="xfce-resource-match.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>type of the resource to locate directories for.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>pattern</p></td>
<td class="parameter_description"><p>only accept filenames that fit to the pattern. The pattern
needs to be a valid GPattern.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>unique</p></td>
<td class="parameter_description"><p>if <code class="literal">TRUE</code>, only return items which have unique suffixes.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xfce-resource-match.returns"></a><h4>Returns</h4>
<p>string array of all the relative paths whose names matches the
given <em class="parameter"><code>pattern</code></em>
. The return value has to be freed using
<code class="function">g_strfreev()</code> when no longer needed. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-4-2.html#api-index-4.2">4.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="xfce-resource-match-custom"></a><h3>xfce_resource_match_custom ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> **
xfce_resource_match_custom (<em class="parameter"><code><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceResourceType" title="enum XfceResourceType"><span class="type">XfceResourceType</span></a> type</code></em>,
                            <em class="parameter"><code><span class="type">gboolean</span> unique</code></em>,
                            <em class="parameter"><code><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceMatchFunc" title="XfceMatchFunc ()"><span class="type">XfceMatchFunc</span></a> func</code></em>,
                            <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>Yet to be implemented!</p>
<div class="refsect3">
<a name="xfce-resource-match-custom.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>type of the resource to locate directories for.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>unique</p></td>
<td class="parameter_description"><p>if <code class="literal">TRUE</code>, only return items which have unique suffixes.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description"><p>(scope call) : callback to determine if there was a match</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>caller defined data</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xfce-resource-match-custom.returns"></a><h4>Returns</h4>
<p>The caller is responsible to free
the returned string array using <code class="function">g_strfreev()</code> when no longer needed. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-4-2.html#api-index-4.2">4.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="xfce-resource-push-path"></a><h3>xfce_resource_push_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
xfce_resource_push_path (<em class="parameter"><code><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceResourceType" title="enum XfceResourceType"><span class="type">XfceResourceType</span></a> type</code></em>,
                         <em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>);</pre>
<p>Appends <em class="parameter"><code>path</code></em>
 to the search path list for <em class="parameter"><code>type</code></em>
. This function was
written primary for use within modules in larger applications, for example
MCS plugins.</p>
<p>For example, if you need to add a specific path to the search path list
in your MCS, you should call <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-push-path" title="xfce_resource_push_path ()"><code class="function">xfce_resource_push_path()</code></a> prior to calling
one of the resource search functions and call <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-pop-path" title="xfce_resource_pop_path ()"><code class="function">xfce_resource_pop_path()</code></a>
right afterwards.</p>
<div class="refsect3">
<a name="xfce-resource-push-path.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>type of the resource which search list should be expanded.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>search path to add.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-4-2.html#api-index-4.2">4.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="xfce-resource-pop-path"></a><h3>xfce_resource_pop_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
xfce_resource_pop_path (<em class="parameter"><code><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceResourceType" title="enum XfceResourceType"><span class="type">XfceResourceType</span></a> type</code></em>);</pre>
<p>Undoes the effect of the latest call to <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-push-path" title="xfce_resource_push_path ()"><code class="function">xfce_resource_push_path()</code></a>. You
should take special care to call <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-pop-path" title="xfce_resource_pop_path ()"><code class="function">xfce_resource_pop_path()</code></a> exactly same
times as <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-push-path" title="xfce_resource_push_path ()"><code class="function">xfce_resource_push_path()</code></a>, everything else might result in
unwanted and maybe even undefined behaviour. You have been warned!</p>
<div class="refsect3">
<a name="xfce-resource-pop-path.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>type of the resource which search list should be shrinked.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-4-2.html#api-index-4.2">4.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="xfce-resource-save-location"></a><h3>xfce_resource_save_location ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
xfce_resource_save_location (<em class="parameter"><code><a class="link" href="libxfce4util-Resource-lookup-functions.html#XfceResourceType" title="enum XfceResourceType"><span class="type">XfceResourceType</span></a> type</code></em>,
                             <em class="parameter"><code>const <span class="type">gchar</span> *relpath</code></em>,
                             <em class="parameter"><code><span class="type">gboolean</span> create</code></em>);</pre>
<p>If <em class="parameter"><code>relpath</code></em>
 contains a trailing slash ('/') character, <a class="link" href="libxfce4util-Resource-lookup-functions.html#xfce-resource-save-location" title="xfce_resource_save_location ()"><code class="function">xfce_resource_save_location()</code></a>
finds the directory to save files into for the given type in the user's
home directory. All directories needed (including those given by
<em class="parameter"><code>relpath</code></em>
) will be created on demand if <em class="parameter"><code>create</code></em>
 if <code class="literal">TRUE</code>.</p>
<p>If <em class="parameter"><code>relpath</code></em>
 does not end with a slash ('/') character, it is taken to be
the name of a file to return the save location for. All the directories
needed will be created on demand if <em class="parameter"><code>create</code></em>
 is <code class="literal">TRUE</code>.</p>
<p>Specifying <code class="literal">NULL</code> or the empty string for <em class="parameter"><code>relpath</code></em>
 allows you to discover
the base path for saving files of the specified <em class="parameter"><code>type</code></em>
, though normally
you should not need this.</p>
<div class="refsect3">
<a name="xfce-resource-save-location.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>type of location to return.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>relpath</p></td>
<td class="parameter_description"><p>relative path of the resource.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>create</p></td>
<td class="parameter_description"><p>whether to create missing directory.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xfce-resource-save-location.returns"></a><h4>Returns</h4>
<p>the path where resources of the specified <em class="parameter"><code>type</code></em>
should be
saved or <code class="literal">NULL</code> on error. The returned string should be freed
when no longer needed. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-4-2.html#api-index-4.2">4.2</a></p>
</div>
</div>
<div class="refsect1">
<a name="libxfce4util-Resource-lookup-functions.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="XfceResourceType"></a><h3>enum XfceResourceType</h3>
<div class="refsect3">
<a name="XfceResourceType.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="XFCE-RESOURCE-DATA:CAPS"></a>XFCE_RESOURCE_DATA</p></td>
<td class="enum_member_description">
<p>where applications store data.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="XFCE-RESOURCE-CONFIG:CAPS"></a>XFCE_RESOURCE_CONFIG</p></td>
<td class="enum_member_description">
<p>configuration files.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="XFCE-RESOURCE-CACHE:CAPS"></a>XFCE_RESOURCE_CACHE</p></td>
<td class="enum_member_description">
<p>cached information.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="XFCE-RESOURCE-ICONS:CAPS"></a>XFCE_RESOURCE_ICONS</p></td>
<td class="enum_member_description">
<p>icon search path.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="XFCE-RESOURCE-THEMES:CAPS"></a>XFCE_RESOURCE_THEMES</p></td>
<td class="enum_member_description">
<p>themes search path.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>